Skip to content

[PWGHF] Replace UPC Lc THnSparse with TTree#15786

Open
Rrantu wants to merge 7 commits intoAliceO2Group:masterfrom
Rrantu:Lc
Open

[PWGHF] Replace UPC Lc THnSparse with TTree#15786
Rrantu wants to merge 7 commits intoAliceO2Group:masterfrom
Rrantu:Lc

Conversation

@Rrantu
Copy link
Copy Markdown
Contributor

@Rrantu Rrantu commented Apr 15, 2026

This PR introduces a transition from THnSparse to TTree in the UPC Lc analysis.
Main changes:

  • Added UPC Lc columns and tables in utilsUpcHf.h
  • Implemented production and filling of TTree in taskLc.cxx
  • Removed UPC-related axes from the THnSparse

@github-actions github-actions bot added the pwghf PWG-HF label Apr 15, 2026
@github-actions github-actions bot changed the title Replace UPC Lc THnSparse with TTree [PWGHF] Replace UPC Lc THnSparse with TTree Apr 15, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 0 disabled

@vkucera vkucera marked this pull request as draft April 15, 2026 12:54
@vkucera
Copy link
Copy Markdown
Collaborator

vkucera commented Apr 15, 2026

@Rrantu Columns and tables are parts of the data model. They don't belong in the utility headers.

@Rrantu
Copy link
Copy Markdown
Contributor Author

Rrantu commented Apr 15, 2026

Hi @vkucera, thanks for the comment, where would you recommend moving the columns and tables to? Would it be acceptable to define them directly in the task?

@vkucera
Copy link
Copy Markdown
Collaborator

vkucera commented Apr 15, 2026

Hi @vkucera, thanks for the comment, where would you recommend moving the columns and tables to? Would it be acceptable to define them directly in the task?

Yes, if the tables are not used anywhere else, please put them in the task.

@Rrantu Rrantu marked this pull request as ready for review April 15, 2026 14:03
@Rrantu
Copy link
Copy Markdown
Contributor Author

Rrantu commented Apr 15, 2026

Hi @vkucera, thanks for the comment, where would you recommend moving the columns and tables to? Would it be acceptable to define them directly in the task?

Yes, if the tables are not used anywhere else, please put them in the task.

Thanks! I‘ve moved them to the task file

Comment thread PWGHF/D2H/Tasks/taskLc.cxx Outdated
Comment on lines +114 to +117
DECLARE_SOA_TABLE(HfUpcLcInfos, "AOD", "HFUPCLCINFOS",
full::M,
full::Pt,
full::PtProng0,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you duplicate columns in both tables?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One table corresponds to the BDT-applied version, while the other does not. However, both require the mass and pt information.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You never fill both tables. It would be better to have one table with the common columns that you fill in any case and a second table with the extra columns for the BDT case.

DECLARE_SOA_COLUMN(ZdcTimeZNC, zdcTimeZNC, float);
} // namespace full

DECLARE_SOA_TABLE(HfUpcLcBdtInfos, "AOD", "HFUPCLCBDTINFOS",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you call this table BDT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the tree includes BDT scores for the candidates.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it also includes other BDT-unrelated columns. See my comment above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. Here the detector variables and the BDT output are both required together for offline selections. Given this use case, I would prefer to keep the current structure.

Comment thread PWGHF/D2H/Tasks/taskLc.cxx Outdated
// ThnSparse for ML outputScores and Vars
Configurable<bool> fillTHn{"fillTHn", false, "fill THn"};
Configurable<bool> fillUPCTHnLite{"fillUPCTHnLite", false, "fill THn"};
Configurable<bool> fillUPCTreeLite{"fillUPCTreeLite", false, "fill THn"};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only have a single option to fill the trees. It seems that the attributes UPC and Lite are redundant.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the comment is wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment! The Lite one fills fewer candidates, including only those passing the single-gap selection.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it should be called something like fillTreeOnlySingleGap and explained in the comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, I have renamed it.

@vkucera
Copy link
Copy Markdown
Collaborator

vkucera commented Apr 15, 2026

@Rrantu A conceptual question: Why can you not use the THnSparse?

@Rrantu
Copy link
Copy Markdown
Contributor Author

Rrantu commented Apr 15, 2026

@Rrantu A conceptual question: Why can you not use the THnSparse?

Thanks for the question! For large statistics, merging THnSparse objects becomes very heavy, making it difficult to obtain merged AnalysisResults.root. I also need to repeatedly adjust selections on multiple axes during the offline analysis. Projections from high-dimensional THnSparse are not very flexible.

@Rrantu Rrantu requested a review from vkucera April 15, 2026 14:59
@lubynets
Copy link
Copy Markdown
Contributor

Dear @Rrantu, @vkucera, all codeowners, sorry for interfering,
Are Tasks, and not TableProducers, supposed to produce trees? https://aliceo2group.github.io/analysis-framework/docs/gettingstarted/theo2physicsrepo.html#folder-structure

@vkucera
Copy link
Copy Markdown
Collaborator

vkucera commented Apr 15, 2026

Dear @Rrantu, @vkucera, all codeowners, sorry for interfering, Are Tasks, and not TableProducers, supposed to produce trees? https://aliceo2group.github.io/analysis-framework/docs/gettingstarted/theo2physicsrepo.html#folder-structure

No, they are not.

@Rrantu
Copy link
Copy Markdown
Contributor Author

Rrantu commented Apr 15, 2026

Hi @lubynets, Thanks for the question. In this case, the tables are only used within this task, and the trees are produced specifically for this analysis. Also, there are other tasks that produce trees in a similar way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pwghf PWG-HF

Development

Successfully merging this pull request may close these issues.

3 participants